package org.mikeliu.exp6.homework1;

import java.util.Scanner;
public class Main {
    
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        Book b1 = new Book(s.next(),
                s.nextInt(),
                s.next(),
                s.nextInt());
        Book b2 = new Book(s.next(),s.nextInt(),s.next(),s.nextInt());
        
        System.out.println(b1);
        System.out.println(b2);
        System.out.println(b1.equals(b2));
            
    }

}

class Book {
	private String name;
	private int price;
	private String author;
	private int edition;
	public Book(String name, int price, String author, int edition) {
		super();
		this.name = name;
		this.price = price;
		this.author = author;
		this.edition = edition;
	}
	@Override
	public String toString() {
		return "name: " + name + ", price: " + price + ", author: " + author + ", edition: " + edition ;
	}
	@Override
	public boolean equals(Object obj) {
		if(this.name.equalsIgnoreCase(((Book)obj).name)&&this.edition==((Book)obj).edition&&this.author.equalsIgnoreCase(((Book)obj).author)) {
			return true;
		}
		else {
			return false;
		}
		
	}
}